var status = -1;
var selectionLog = [];

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.setNumberForQuestInfo(59785, "867110550", 1);
            cm.fieldEffect_复合图片动画(["Map/EffectPL.img/3min/notice_spine/bossWarn/skeleton_warning_boss", "animation", "", ""], [0, 1, 1, 5000, 0, 0, 0, 0]);
            cm.effect_Voice("PL_3min.img/effectSound/BossWarn", 100);
            cm.addNumberForQuestInfo(59791, "bCount", 1);
            cm.getPlayer().scheduleWarpTask(4, 867110600 + cm.rand(0, 2) * 50, 0);
            cm.dispose();
            checkStage()
        } else {
            cm.dispose()
        }
    }
}

function checkStage() {
    for (var a = 867110050; a <= 867110700; a += 50) {
        if (!cm.getInfoQuest(59785).contains("" + a)) {
            return
        }
    }
    cm.setNumberForQuestInfo(59785, "stage", 1)
}

function start() {
    status = -1;
    action(1, 0, 0)
};